/*
 * @Author: liqiang liqiang@hacint.com.cn
 * @Date: 2023-08-19 17:03:21
 * @LastEditors: liqiang liqiang@hacint.com.cn
 * @LastEditTime: 2023-08-20 11:26:38
 * @FilePath: \USERf:\WorkTest\WireTest4096\PIM4096MotherBoard\WireTest4096 V1.01.01\MidWare\ParaConfig\ParaConfig.c
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
 

#include "ParaConfig.h" 



 
enum    {
        PARA_MAX_PIN = 4096, 
        PARA_DEFAULT_PIN = 2048,
};

static PinNum_TypeDef  userUsedPinNum={2048,4096};/*初始化 本机2048点，最大4096点*/
static LocalSignal_TypeDef     localSignal={0x0408}      ;




/*本地函数声明*/


void    SetDefaultPin(void){
        userUsedPinNum.usedPinMax = PARA_DEFAULT_PIN;
}
unsigned short GetDefaultPin(void){
        return  PARA_DEFAULT_PIN;
}
unsigned short CheckDefaultPin(void){
        if(GetDefaultPin()==userUsedPinNum.usedPinMax){
                return 1;
        }else{
                return 0;
        } 
}




unsigned    short    CheckPinNumberMax(void) { 
        userUsedPinNum.pinNumberMax = GetPinNumMax();
        return  userUsedPinNum.pinNumberMax;
}
unsigned    short   GetPinNumMax(void) {
        return (unsigned short)PARA_MAX_PIN;
}
void    SetPinNumMax(void){
        userUsedPinNum.pinNumberMax = GetPinNumMax();
}





void    CheckUserUsedPinNum(void) {
        if((userUsedPinNum.usedPinMax>GetPinNumMax())|| \
                (userUsedPinNum.usedPinMax<=0)) {
            userUsedPinNum.usedPinMax   = GetPinNumMax()/2;            
        } 
}

 unsigned        short    GetUserUsedPinNum(void) {
        return  userUsedPinNum.usedPinMax;
}   

void    SetUserUsedPinNum(unsigned short number){
        CheckPinNumberMax();
        if(number>GetPinNumMax()){
             SetDefaultPin();  
             return; 
        }
        if(number<=0){
             SetDefaultPin();   
             return;
        } 
        userUsedPinNum.usedPinMax = number;
}





unsigned        char GetLocalSignalWaitTime(void) {
        return  localSignal.Set.Time;
}

void    SetLocalSignalWaitTime(unsigned char time) {
        localSignal.Set.Time = time;
}

unsigned        char GetLocalSingalSetCount(void) {
        return  localSignal.Set.Cnt;
}

void    SetLocalSingalSetCount(unsigned short count) {
        localSignal.Set.Cnt     = count;
}

unsigned        short   GetLocalSignal(void){
        return  localSignal.setTimeCnt;
}
void    SetLocalSignal(unsigned short signal){
        localSignal.setTimeCnt = signal ;
}




 


/**
 * @brief  以下是单元测试
 * 
 */







 



